// src/main/service/UserService.js
const sequelize = require('../db/index.js');


const userModel = sequelize.model('user');

class UserService {
  static async save(user) {
    return await userModel.create(user);
  }

  static async findById(id) {
    return await userModel.findByPk(id);
  }

  static async updateById(user) {
    return await userModel.update(user, {
      where: {
        id: user.id
      }
    });
  }
};

module.exports = UserService
